home *** CD-ROM | disk | FTP | other *** search
- PXFCHMOD(3F) Last changed: 1-22-99
-
-
- NNAAMMEE
- PPXXFFCCHHMMOODD - Sets file modes for a named file
-
- SSYYNNOOPPSSIISS
- CCHHAARRAACCTTEERR*_n _p_a_t_h
- IINNTTEEGGEERR _i_l_e_n,, _i_m_o_d_e,, _i_e_r_r_o_r
- CCAALLLL PPXXFFCCHHMMOODD((_p_a_t_h,, _i_l_e_n,, _i_m_o_d_e,, _i_e_r_r_o_r))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- IEEE standard interface for FORTRAN 77
-
- DDEESSCCRRIIPPTTIIOONN
- On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
- default when compiling programs with the MIPSpro 7 Fortran 90 compiler
- or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
- F77 compiler.
-
- The PPXXFFCCHHMMOODD subroutine uses the cchhmmoodd(2) function to set file modes
- for the named file.
-
- The value of _i_m_o_d_e indicates specific file modes. cchhmmoodd() changes the
- current file modes for the named file in _p_a_t_h to the file mode
- specified in _i_m_o_d_e.
-
- When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
- UNICOS, UNICOS/mk, or IRIX system, all arguments must be of default
- kind unless documented otherwise. On UNICOS and UNICOS/mk, default
- kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
- IRIX, the default kind is KKIINNDD==44.
-
- The following is a list of valid arguments for this subroutine:
-
- _p_a_t_h Input character variable or array element containing the
- name of a file.
-
- _i_l_e_n Input integer variable containing the length of _p_a_t_h in
- characters. If _i_l_e_n is zero, all trailing blanks are
- removed before calling cchhmmoodd().
-
- _i_m_o_d_e Input integer variable containing the integer value of the
- symbolic constant for one or more of the following file
- modes:
-
- UUSSEERR RREEAADD permissions bit: SS__IIRRUUSSRR
- WWRRIITTEE permissions bit: SS__IIWWUUSSRR
- SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit: SS__IIXXUUSSRR
- Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE: SS__IIRRWWXXUU
-
- GGRROOUUPP RREEAADD permissions bit: SS__IIRRGGRRPP
- WWRRIITTEE permissions bit: SS__IIWWGGRRPP
- SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit: SS__IIXXGGRRPP
- Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE: SS__IIRRWWXXGG
-
- OOTTHHEERR RREEAADD permissions bit: SS__IIRROOTTHH
- WWRRIITTEE permissions bit: SS__IIWWOOTTHH
- SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit: SS__IIXXOOTTHH
- Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE: SS__IIRRWWXXOO
-
- SSEETTIIDD Set user IIDD on execution: SS__IISSUUIIDD
- Set group IIDD on execution: SS__IISSGGIIDD
-
- An integer value for each of these symbolic
- constants is retrieved through the use of
- PPXXFFCCOONNSSTT(3F) or IIPPXXFFCCOONNSSTT(3F). The integer values
- may be combined through the use of a bitwise
- inclusive OORR function.
-
- _i_e_r_r_o_r Output integer variable that contains zero if the requested
- file mode bits are set or nonzero if the requested file mode
- bits are not set.
-
- In addition to the errors returned by the cchhmmoodd(2) system call,
- PPXXFFCCHHMMOODD may return the following errors:
-
- EEIINNVVAALL If _i_l_e_n < 0 or _i_l_e_n > LLEENN((_p_a_t_h)).
-
- EENNOOMMEEMM If PPXXFFCCHHMMOODD is unable to obtain memory to copy _p_a_t_h.
-
- EEXXAAMMPPLLEESS
- program test
- character*(12) path
- integer ilen, imod, ierr, imodr, imodw
- path = 'testfile'
- imod = 0
- imodr = 0
- imodw = 0
- ilen = 0
-
- call pxfconst('S_IRUSR',imodr,ierr)
- if (ierr.ne.0) then
- print *,'FAIL: error from pxfconst S_IRUSR = ',ierr
- stop
- endif
- call pxfconst('S_IROTH',imodw,ierr)
- if (ierr.ne.0) then
- print *,'FAIL: error from pxfconst S_IWUSR = ',ierr
- stop
- endif
- imod = IOR(imodr,imodw)
- call pxfchmod(path,ilen,imod,ierr)
- if (ierr.ne.0) then
- print *,'FAIL: error from pxfchmod = ',ierr
- else
- print *,'PASS: No error from pxfchmod'
- endif
- end
-
- SSEEEE AALLSSOO
- cchhmmoodd(2)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
- version of this man page.
-